//
//  UIView+Addition.m
//  Weibo
//
//  Created by taoshanchang on 15/2/2.
//  Copyright (c) 2015年 taoshanchang. All rights reserved.
//

#import "UIView+Addition.h"

@implementation UIView (Addition)

-(UIViewController *)viewController{
    UIResponder *next = [self nextResponder];
    
    do {
        if ([next isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)next;
        }else{
            next = [next nextResponder];
        }
    } while (next != nil);
    
    return nil;

}


@end
